package com.han.spring.core.di_way;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.han.spring.core.create_container.User;

/**
* @author hanpeng
* @version 创建时间：2020年7月7日 上午10:44:35
* @ClassName 类名称
* @Description 类描述
*/
public class DITest {
	@Test
	public void testConstruct() {
		ApplicationContext context = new ClassPathXmlApplicationContext("di_way.xml");
		ExampleBean exampleBean = context.getBean("exampleBean", ExampleBean.class);
		System.out.println(exampleBean.getAge());
	}
	@Test
	public void testAnnotion() {
		ApplicationContext context = new ClassPathXmlApplicationContext("di_way.xml");
		AnnotaUser annotaUser = context.getBean("annotaUser", AnnotaUser.class);
		System.out.println(annotaUser);
	}
}
